package com.neu.controller;

import com.neu.entity.dto.DIDTO;
import com.neu.service.FpDIValueService;
import com.neu.base.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/di")
public class DIController {

    @Autowired
    private FpDIValueService fpDIValueService;

    @PostMapping("/task")
    public Result saveDI(@RequestBody DIDTO diDTO) {


        return fpDIValueService.saveDI(diDTO);
    }

    /**
     * 获取指定任务的 DI 数据
     */
    @GetMapping("/task/{taskId}")
    public Result getDI(@PathVariable String taskId) {
        return Result.success(fpDIValueService.getDIByTaskId(taskId));
    }
}
